<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>day05</title>
</head>
<body>
    
</body>
</html>


<script>
var url = "https://nowcoder.com/online?id=1&salas=1000"; function jqueryUrl(url){
var arr = url.split('?');
  //取地址右边参数部分从"&"位置继续分割，成为单独参数列表
var params = arr[1].split('&'); 
  //定义一个空对象
 var obj = {};
 for(var i=0;i<params.length;i++){
 var param = params[i].split('='); //得到[a,1]、[b,2]、[c,3]
 obj[param[0]] = param[1]; //为对象赋值
 }
 return obj;
 }
console.log(jqueryUrl(url));




</script>